<?php
/**
 * Module Template
 *
 * Displays address-book details/selection
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_address_book_details.php 5924 2007-02-28 08:25:15Z drbyte $
 */
?>
<div class="col_2">
	<h2><img src="images/order/tit_delivery.png" /></h2>
            
	<div class="alert forward"><?php echo FORM_REQUIRED_INFORMATION; ?></div>
	
	<table width="100%" border="0">
      <tr>
        <td height="35" valign="middle">名字：</td>
        <td>
            <?php echo zen_draw_input_field('firstname', $entry->fields['entry_firstname'], zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' id="firstname" class="ipt" ') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?>
		</td>
      </tr>
      <tr>
        <td height="35" valign="middle">联系电话：</td>
        <td><?php echo zen_draw_input_field('telephone', $entry->fields['entry_telephone'], zen_set_field_length(TABLE_CUSTOMERS, 'entry_telephone', '40') . ' id="telephone" class="ipt" ') . (zen_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?>
		</td>
      </tr>
      <tr>
        <td height="35" valign="middle">详细地址：</td>
        <td><?php echo zen_draw_input_field('street_address', $entry->fields['entry_street_address'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', '40') . ' id="street-address" class="ipt"') . (zen_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="alert">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?>
		</td>
      </tr>
      <tr>
        <td height="35" valign="middle">城市：</td>
        <td><?php echo zen_draw_input_field('city', $entry->fields['entry_city'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' id="city" class="ipt"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' . ENTRY_CITY_TEXT . '</span>': ''); ?>
		</td>
      </tr>
      <?php
          if (ACCOUNT_STATE == 'true') {
            if ($flag_show_pulldown_states == true) {
        ?>
        <tr>
        <td height="35" valign="middle">省份：</td>
        <td>
        <?php
              echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone" class="ipt"');
              if (zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert">' . ENTRY_STATE_TEXT . '</span>';
        ?>
        </td>
      	</tr>
        <?php 
            }
          }
        ?>
    
      <tr>
        <td height="35" valign="middle">邮编：</td>
        <td><?php echo zen_draw_input_field('postcode', $entry->fields['entry_postcode'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode" class="ipt" ') . (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?>
		</td>
      </tr>
      <tr>
        <td height="35" valign="middle">国家或地区：</td>
        <td>
        <?php echo zen_get_country_list('zone_country_id', $entry->fields['entry_country_id'], 'id="country" class="ipt" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?>
        
        </td>
      </tr>
       <?php
      if ((isset($_GET['edit']) && ($_SESSION['customer_default_address_id'] != $_GET['edit'])) || (isset($_GET['edit']) == false) ) {
    ?>
    <tr><td>
    <?php
    //设为主要地址，是否打勾
    echo zen_draw_checkbox_field('primary', 'on', false, 'id="primary"') . ' <label class="checkboxLabel" for="primary">' . SET_AS_PRIMARY . '</label>'; 
    ?>
    </td></tr>
    <?php
      }
    ?>
    
      <?php
    if (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
        //是否为新增地址，或更新地址
    ?>
    <tr>
    <td>
    <!-- <input type="submit" value="" class="btn_modify" />  --> 
    <?php echo zen_draw_hidden_field('action', 'update') . zen_draw_hidden_field('edit', $_GET['edit']) . zen_image_submit(BUTTON_IMAGE_UPDATE, BUTTON_UPDATE_ALT); ?>
    </td>
    <!-- 
    <div class="buttonRow back"><?php echo '<a href="' . zen_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?>
     -->  
     </tr>  
    <?php
        } else {
    ?>
    <tr><td>
    <div class="buttonRow forward"><?php echo zen_draw_hidden_field('action', 'process') . zen_image_submit(BUTTON_IMAGE_SUBMIT, BUTTON_SUBMIT_ALT); ?></div>
    <!-- 
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
     -->
     </td></tr>
    <?php
     }
    ?>
	<!-- 
      <tr>
        <td height="35" valign="middle"></td>
        <td valign="middle"><input type="submit" value="" class="btn_modify" /> <input type="reset" value="重设" class="btn_reset" /></td>
      </tr>
    -->
    
     
    
    </table>
</div>
